﻿@{
    Layout = null;
}
@model System.Collections.IEnumerable
<!DOCTYPE html>

<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title></title>
 @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(

    new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
    )
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
    )


    <script>
        //    $(function () { 
        //        alert()
        //    });

        function nodeClick(s, e) {
            //var pane = ContentSplitter.GetPaneByName('ContentCenter');
            //pane.SetContentUrl("/Admin/Empl/" + e.node.name);
            parent.$("#contentframe").attr("src", rootPath + "/Admin/Empl/" + e.node.name);
        }

        function treeInit() {
            if (parent.$('#hidContent').val() == "Y") {
                //var pane = ContentSplitter.GetPaneByName('ContentCenter');
                //pane.SetContentUrl("/Admin/Empl/EmpContent");
                parent.$("#contentframe").attr("src", rootPath + "/Admin/Empl/EmpContent");
            }
        }
        
    </script>

</head>
<body onload="treeInit()">
   <div class="leftPanel">
        @Html.DevExpress().TreeView(settings =>
{
    settings.Name = "LeftTreeView";
    settings.ShowTreeLines = true;
    settings.AllowSelectNode = true;
    settings.NameField = "Id";
    settings.TextField = "Name";
    settings.ImageUrlField = "ImageUrl";
    settings.ClientSideEvents.NodeClick = "function(s, e) { nodeClick(s,e) }";
    settings.ClientSideEvents.Init = "treeInit";
    settings.EnableAnimation = false;
    settings.PreRender = (source, e) =>
    {
        ASPxTreeView treeView = (ASPxTreeView)source;
        treeView.ExpandToDepth(0);
    };

}).Bind(Model).GetHtml()
    </div>

    <script>
        lp.Hide();
    </script>
</body>
</html>
